exports.FIELD_ERR_MSG =  'field name or value validation failed';

var errors = [];

var SUCCESS = exports.SUCCESS = 200;
errors[SUCCESS] = '成功';

var UNKNOWN_ERR_CODE = exports.UNKNOWN_ERR_CODE = 1;
errors[UNKNOWN_ERR_CODE] = '未知错误';

var INSIDE_ERR_CODE = exports.INSIDE_ERR_CODE = 2;
errors[INSIDE_ERR_CODE] = '内部错误';

var NETWORK_ERR_CODE = exports.NETWORK_ERR_CODE = 3;
errors[NETWORK_ERR_CODE] = '网络错误，请稍后重试';

var DB_EXCEPTION_ERR_CODE = exports.DB_EXCEPTION_ERR_CODE = 4;
errors[DB_EXCEPTION_ERR_CODE] = '数据服务异常,请稍后重试';

var DB_CONSTRAINT_ERR_CODE = exports.DB_CONSTRAINT_ERR_CODE = 5;
errors[DB_CONSTRAINT_ERR_CODE] = '数据不符合约束条件,过长、重复或格式错误';

var REQ_PARAM_ERR_CODE = exports.REQ_PARAM_ERR_CODE = 6;
errors[REQ_PARAM_ERR_CODE] = '请求参数为空或格式不对，不被接受!';

var SIGN_ERR_CODE = exports.SIGN_ERR_CODE = 7;
errors[SIGN_ERR_CODE] = '签名校验失败!';

var RECORD_NOT_EXISTS_ERR_CODE = exports.RECORD_NOT_EXISTS_ERR_CODE = 10;
errors[RECORD_NOT_EXISTS_ERR_CODE] = '没有数据!';

var REGISTER_MOBILE_EXISTS_ERR_CODE = exports.REGISTER_MOBILE_EXISTS_ERR_CODE = 11;
errors[REGISTER_MOBILE_EXISTS_ERR_CODE] = '手机号已存在或格式错误';

var USERNAME_EXISTS_ERR_CODE = exports.USERNAME_EXISTS_ERR_CODE = 12;
errors[USERNAME_EXISTS_ERR_CODE] = '人人明星号已存在，请换一个';

var PHONE_NUMBER_EXISTS_ERR_CODE = exports.PHONE_NUMBER_EXISTS_ERR_CODE = 13;
errors[PHONE_NUMBER_EXISTS_ERR_CODE] = '电话号码已存在';

var TOKEN_SAVE_ERR_CODE = exports.TOKEN_SAVE_ERR_CODE = 14;
errors[TOKEN_SAVE_ERR_CODE] = 'token保存失败';

var ACCOUNT_LOCK_ERR_CODE = exports.ACCOUNT_LOCK_ERR_CODE = 15;
errors[ACCOUNT_LOCK_ERR_CODE] = '账号被锁定,暂时不能登录';

var ACCOUNT_TERMINATION_ERR_CODE = exports.ACCOUNT_TERMINATION_ERR_CODE = 16;
errors[ACCOUNT_TERMINATION_ERR_CODE] = '账号被封,不能登录';

var AUTH_PHONE_PASSWORD_ERR_CODE = exports.AUTH_PHONE_PASSWORD_ERR_CODE = 17;
errors[AUTH_PHONE_PASSWORD_ERR_CODE] = '电话号码或密码错误';

var AUTH_PHONE_PASSWORD_EMPTY_ERR_CODE = exports.AUTH_PHONE_PASSWORD_EMPTY_ERR_CODE = 18;
errors[AUTH_PHONE_PASSWORD_EMPTY_ERR_CODE] = '电话号码和密码不能为空';

var AUTH_MOBILE_FORMAT_ERR_CODE = exports.AUTH_MOBILE_FORMAT_ERR_CODE = 19;
errors[AUTH_MOBILE_FORMAT_ERR_CODE] = '不是有效的手机号码';

var PASSWORD_TOO_SIMPLY_ERR_CODE = exports.PASSWORD_TOO_SIMPLY_ERR_CODE = 20;
errors[PASSWORD_TOO_SIMPLY_ERR_CODE] = '密码太简单了';

var USER_NOT_EXISTS_ERR_CODE = exports.USER_NOT_EXISTS_ERR_CODE = 21;
errors[USER_NOT_EXISTS_ERR_CODE] = '用户不存在';

var MOBILE_CHECK_ERR_CODE = exports.MOBILE_CHECK_ERR_CODE = 22;
errors[MOBILE_CHECK_ERR_CODE] = '手机号码可能无效，验证码发送失败';

var ACCOUNT_STATUS_ERR_CODE = exports.ACCOUNT_STATUS_ERR_CODE = 23;
errors[ACCOUNT_STATUS_ERR_CODE] = '用户处于非正常状态';

var ACCOUNT_EXISTS_ERR_CODE = exports.ACCOUNT_EXISTS_ERR_CODE = 24;
errors[ACCOUNT_EXISTS_ERR_CODE] = '用户已存在';

var CAPTCHA_INVALID_ERR_CODE = exports.CAPTCHA_INVALID_ERR_CODE = 25;
errors[CAPTCHA_INVALID_ERR_CODE] = '验证码错误';

var CAPTCHA_EXPIRE_ERR_CODE = exports.CAPTCHA_EXPIRE_ERR_CODE = 26;
errors[CAPTCHA_EXPIRE_ERR_CODE] = '验证码已过期';

var CAPTCHA_SEND_TOO_ERR_CODE = exports.CAPTCHA_SEND_TOO_ERR_CODE = 27;
errors[CAPTCHA_SEND_TOO_ERR_CODE] = '验证码请求次数过多，请耐心等待';

var AUTH_OLD_PASSWORD_ERR_CODE = exports.AUTH_OLD_PASSWORD_ERR_CODE = 28;
errors[AUTH_OLD_PASSWORD_ERR_CODE] = '旧密码错误';

var VERSION_NOT_EXISTS_ERR_CODE = exports.VERSION_NOT_EXISTS_ERR_CODE = 29;
errors[VERSION_NOT_EXISTS_ERR_CODE] = '版本没查到';

var VERSION_LATEST_ERR_CODE = exports.VERSION_LATEST_ERR_CODE = 30;
errors[VERSION_LATEST_ERR_CODE] = '当前是最新版本';

var VERSION_EXISTS_ERR_CODE = exports.VERSION_EXISTS_ERR_CODE = 31;
errors[VERSION_EXISTS_ERR_CODE] = '版本号已存在';

var LEVEL_NOT_EXISTS_ERR_CODE = exports.LEVEL_NOT_EXISTS_ERR_CODE = 39;
errors[LEVEL_NOT_EXISTS_ERR_CODE] = '级别数据没查到';

var OFFER_NOT_EXISTS_ERR_CODE = exports.OFFER_NOT_EXISTS_ERR_CODE = 41;
errors[OFFER_NOT_EXISTS_ERR_CODE] = '礼物单不存在';

var OFFER_STATUS_CHANGE_ERR_CODE = exports.OFFER_STATUS_CHANGE_ERR_CODE = 42;
errors[OFFER_STATUS_CHANGE_ERR_CODE] = '礼物单状态已改变，不能进行该操作';

var OFFER_NOT_DELETE_ERR_CODE = exports.OFFER_NOT_DELETE_ERR_CODE = 43;
errors[OFFER_NOT_DELETE_ERR_CODE] = '只有取消和被拒绝的礼物单才能删除';

var CAPITAL_ACCOUNT_EXISTS_ERR_CODE = exports.CAPITAL_ACCOUNT_EXISTS_ERR_CODE = 50;
errors[CAPITAL_ACCOUNT_EXISTS_ERR_CODE] = '账号已存在';

var CAPITAL_NOT_EXISTS_ERR_CODE = exports.CAPITAL_NOT_EXISTS_ERR_CODE = 51;
errors[CAPITAL_NOT_EXISTS_ERR_CODE] = '账户信息不存在，请绑定';

var RECHARGE_NOT_EXISTS_ERR_CODE = exports.RECHARGE_NOT_EXISTS_ERR_CODE = 52;
errors[RECHARGE_NOT_EXISTS_ERR_CODE] = '充值记录没查到';

var CASH_NOT_EXISTS_ERR_CODE = exports.CASH_NOT_EXISTS_ERR_CODE = 53;
errors[CASH_NOT_EXISTS_ERR_CODE] = '没有提现记录';

var BALANCE_NOT_ENOUGH_ERR_CODE = exports.BALANCE_NOT_ENOUGH_ERR_CODE = 54;
errors[BALANCE_NOT_ENOUGH_ERR_CODE] = '余额不足,请充值';

var CASH_PROCESSED_ERR_CODE = exports.CASH_PROCESSED_ERR_CODE = 55;
errors[CASH_PROCESSED_ERR_CODE] = '已提现不能取消';

var CASH_CANCEL_ERR_CODE = exports.CASH_CANCEL_ERR_CODE = 56;
errors[CASH_CANCEL_ERR_CODE] = '已取消,不要重复操作';

var CASH_PROCESS_ERR_CODE = exports.CASH_PROCESS_ERR_CODE = 57;
errors[CASH_PROCESS_ERR_CODE] = '提现正在处理中,不能取消';

var RECHARGE_REQ_ERR_CODE = exports.RECHARGE_REQ_ERR_CODE = 58;
errors[RECHARGE_REQ_ERR_CODE] = '充值请求失败，请稍后重试';

var CASH_TRANSFER_REQ_ERR_CODE = exports.CASH_TRANSFER_REQ_ERR_CODE = 59;
errors[CASH_TRANSFER_REQ_ERR_CODE] = '转账请求失败，请稍后重试';

var GIFT_NOT_EXISTS_ERR_CODE = exports.GIFT_NOT_EXISTS_ERR_CODE = 61;
errors[GIFT_NOT_EXISTS_ERR_CODE] = '没有找到礼物';

var ACTIVITY_NOT_EXISTS_ERR_CODE = exports.ACTIVITY_NOT_EXISTS_ERR_CODE = 66;
errors[ACTIVITY_NOT_EXISTS_ERR_CODE] = '没有找到服务';

var ALBUM_NOT_EXISTS_ERR_CODE = exports.ALBUM_NOT_EXISTS_ERR_CODE = 71;
errors[ALBUM_NOT_EXISTS_ERR_CODE] = '没有图片';

var VIDEO_NOT_EXISTS_ERR_CODE = exports.VIDEO_NOT_EXISTS_ERR_CODE = 72;
errors[VIDEO_NOT_EXISTS_ERR_CODE] = '没有视频';

var VIDEO_NOT_AUDIT_ERR_CODE = exports.VIDEO_NOT_AUDIT_ERR_CODE = 73;
errors[VIDEO_NOT_AUDIT_ERR_CODE] = '视频未审核,请稍后操作';

var VIDEO_COVER_DELETE_ERR_CODE = exports.VIDEO_COVER_DELETE_ERR_CODE = 74;
errors[VIDEO_COVER_DELETE_ERR_CODE] = '认证视频不能删除，请先替换替换认证视频再操作';

var COMMNETS_NOT_EXISTS_ERR_CODE = exports.COMMNETS_NOT_EXISTS_ERR_CODE = 75;
errors[COMMNETS_NOT_EXISTS_ERR_CODE] = '还没有评论记录';

var FANS_NOT_EXISTS_ERR_CODE = exports.FANS_NOT_EXISTS_ERR_CODE = 81;
errors[FANS_NOT_EXISTS_ERR_CODE] = '还没有粉丝';

var FANS_BLOCK_DEL_ERR_CODE = exports.FANS_BLOCK_DEL_ERR_CODE = 82;
errors[FANS_BLOCK_DEL_ERR_CODE] = '接受礼物后3个小时内不能屏蔽和删除好友';

var IDOL_NOT_EXISTS_ERR_CODE = exports.IDOL_NOT_EXISTS_ERR_CODE = 83;
errors[IDOL_NOT_EXISTS_ERR_CODE] = '还没有偶像';

var WORKS_NUM_ERR_CODE = exports.WORKS_NUM_ERR_CODE = 91;
errors[WORKS_NUM_ERR_CODE] = '审核通过的演艺作品图片小于5张，不能通过';

var VIDEO_PUSH_EXISTS_ERR_CODE = exports.VIDEO_PUSH_EXISTS_ERR_CODE = 110;
errors[VIDEO_PUSH_EXISTS_ERR_CODE] = '推送设置已存在';

var ACTIVITY_EXISTS_ERR_CODE = exports.ACTIVITY_EXISTS_ERR_CODE = 121;
errors[ACTIVITY_EXISTS_ERR_CODE] = '该项目的约会已存在';

var ORDER_NOT_EXISTS_ERR_CODE = exports.ORDER_NOT_EXISTS_ERR_CODE = 126;
errors[ORDER_NOT_EXISTS_ERR_CODE] = '约单不存在';

var ORDER_STATUS_CHANGE_ERR_CODE = exports.ORDER_STATUS_CHANGE_ERR_CODE = 127;
errors[ORDER_STATUS_CHANGE_ERR_CODE] = '约单状态已改变，不能进行该操作，请刷新';

var ORDER_NOT_DELETE_ERR_CODE = exports.ORDER_NOT_DELETE_ERR_CODE = 128;
errors[ORDER_NOT_DELETE_ERR_CODE] = '只有取消和被拒绝的约单才能删除，请刷新';

var ORDER_PAY_STATUS_ERR_CODE = exports.ORDER_PAY_STATUS_ERR_CODE = 129;
errors[ORDER_PAY_STATUS_ERR_CODE] = '约单状态已改变，不能进行付款操作，请刷新';

var ORDER_ASK_STATUS_ERR_CODE = exports.ORDER_ASK_STATUS_ERR_CODE = 130;
errors[ORDER_ASK_STATUS_ERR_CODE] = '约单状态已改变，不能进行收款操作，请刷新';

var ORDER_CLOSE_STATUS_ERR_CODE = exports.ORDER_CLOSE_STATUS_ERR_CODE = 131;
errors[ORDER_CLOSE_STATUS_ERR_CODE] = '约单状态已改变，不能进行关闭操作，请刷新';

var ORDER_AMOUNT_ERR_CODE = exports.ORDER_AMOUNT_ERR_CODE = 132;
errors[ORDER_AMOUNT_ERR_CODE] = '订单金额不正确';

exports.getReason = function(code){
	return errors[code];
};